<div id="disable_products_form">
	<h2>Enable or Disable Products</h2>
	<div class="content">
		<div class="form400">
			<?= Phpr_Form::openTag() ?>
				<? if (!isset($fatalError)): ?>
					<p>Products selected: <?= $product_count ?></p>
					
					<div class="form">
						<div class="form_page">
							<ul class="formElements">
								<li class="field checkbox">
									<label for="Shop_Product_enabled">Enabled</label>
									<div class="fieldContainer">
										<input type="hidden" class="checkbox" value="" name="enabled"/>
										<input type="checkbox" class="checkbox" value="1" name="enabled" id="Shop_Product_enabled"/>
									</div>
									<p class="minorCommentAfter">Use this checkbox to show or hide the selected product(s) from the website. This option does not affect grouped products.</p>
									<div class="clear"></div>
								</li>

								<li class="field checkbox">
									<label for="Shop_Product_disable_completely">Disable Completely</label>
									<div class="fieldContainer">
										<input type="hidden" class="checkbox" value="" name="disable_completely"/>
										<input type="checkbox" class="checkbox" value="1" name="disable_completely" id="Shop_Product_disable_completely">
									</div>

									<p class="minorCommentAfter">Use this checkbox to hide the selected product(s) and grouped products from the website.</p>
									<div class="clear"></div>
								</li>
							</ul>
							<div class="clear"></div>
						</div>
					</div>
					
					<script type="text/javascript">
						$('disable_products_form').addEvent('popupLoaded', function(){

							var enabled_cb = $('Shop_Product_enabled');
							var disable_compl_cb = $('Shop_Product_disable_completely');
							if (enabled_cb && disable_compl_cb)
							{
								enabled_cb.addEvent('click', function(){
									if (enabled_cb.checked)
										disable_compl_cb.cb_uncheck();
								});
								disable_compl_cb.addEvent('click', function(){
									if (disable_compl_cb.checked)
										enabled_cb.cb_uncheck();
								});
							}
						});
					</script>

					<?= backend_ajax_button('Apply', 'index_onApplyEnabledStatus', array(), "
						confirm: 'Are you sure?', 
						loadIndicator: {injectInElement: true},
						onSuccess: cancelPopup,
						extraFields: $('listShop_Products_index_list_body').getForm(),
						onAfterUpdate: refresh_ui,
						update: 'products_page_content'") ?>

					<?= backend_button('Cancel', array('onclick'=>'return cancelPopup()')) ?>
					<div class="clear"></div>
				<? else: ?>
					<?= flash() ?>
					<?= backend_button('Cancel', array('onclick'=>'return cancelPopup()')) ?>
					<div class="clear"></div>
				<? endif ?>
			</form>
		</div>
	</div>
</div>